import greenfoot.*;  // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)

/**
 * Write a description of class nubes here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class nubes extends Accesorios
{
    /**
     * Act - do whatever the nubes wants to do. This method is called whenever
     * the 'Act' or 'Run' button gets pressed in the environment.
     */
    
   // nubes nub= new nubes(2);
    private int reg;
    /**
     * Constructor de nubes
     * @param recibe el numero de nube que se va a usar
     */
    public nubes(int dato)
    {
        setImage("nube"+(dato-1)+".png");
        reg=dato;
    }
    
    public void act() 
    {
       mueve();
    }
    /**
     * Metodo que se encarga de mover las nubes
     */
    public void mueve()
    {
      if(reg==1)
       if(getX()==0)
        setLocation(700,getY()); 
      
      if(reg==2) 
       if(getX()==0)
         setLocation(700,getY());
   
      if(getX()>0)
       move(-12);
    }
        
  
}
